package com.rd.student.jike.class2.lihongming.week731_806.Day0731;

/**
 * @Auther:Heinrich
 * @Date:2023/7/31-07-31-15:26
 * @Description:c230731.test
 * @version:1.0
 */
public class test03 {
    public static void main(String[] args) {
        int[] arr = new int[50];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = -1;
        }
        int[] result = new int[20];
        for (int i = 0; i < 20; i++) {
            int a = (int) (Math.random()*50);
            if(arr[a] == -1 ){
                arr[a] = a;
                result[i] = a;
                System.out.print(a+" ");
            }else{
                i--;
            }
        }

    }
}
